﻿Public Class Options

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        If HomeURL.Text.Contains("www.") Then
            If HomeURL.Text.Contains("http://") Then
                My.Settings.homeurl = HomeURL.Text
            Else
                My.Settings.homeurl = ("http://") & HomeURL.Text
            End If
            Me.HomeURL.Text = My.Settings.homeurl ' displays the content of the setting in the textbox 
            MsgBox("Home Page Changed")
        Else
            MsgBox("that is a invalid URL")
            HomeURL.Text = "Http://"
        End If

        ' the above code assigns a new homepage to the program and applies the http:// to it



    End Sub

    Private Sub Options_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.HomeURL.Text = My.Settings.homeurl ' displays the content of the setting in the textbox  when the form loads 
    End Sub

    Private Sub UseCurrent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.HomeURL.Text = Form1.AddressBar.Text
    End Sub

    Private Sub Clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        HomeURL.Text = "Http://"
    End Sub
End Class